GtkAllocation *allocation);
static void gtk_label_state_flags_changed (GtkWidget *widget,
GtkStateFlags prev_state);
-static void gtk_label_style_updated (GtkWidget *widget);
-static void gtk_label_direction_changed (GtkWidget *widget,
- GtkTextDirection previous_dir);
static gint gtk_label_draw (GtkWidget *widget,
cairo_t *cr);
static gboolean gtk_label_focus (GtkWidget *widget,
widget_class->destroy = gtk_label_destroy;
widget_class->size_allocate = gtk_label_size_allocate;
widget_class->state_flags_changed = gtk_label_state_flags_changed;
- widget_class->style_updated = gtk_label_style_updated;
widget_class->query_tooltip = gtk_label_query_tooltip;
- widget_class->direction_changed = gtk_label_direction_changed;
widget_class->draw = gtk_label_draw;
widget_class->realize = gtk_label_realize;
widget_class->unrealize = gtk_label_unrealize;
GtkSettings *settings;
gboolean shortcuts_connected;
+ /* The PangoContext is replaced when the screen changes, so clear the layouts */
+ gtk_label_clear_layout (GTK_LABEL (widget));
+
if (!gtk_widget_has_screen (widget))
return;
gtk_label_update_cursor (label);
}
- /* We have to clear the layout, fonts etc. may have changed */
- gtk_label_clear_layout (label);
-
if (GTK_WIDGET_CLASS (gtk_label_parent_class)->state_flags_changed)
GTK_WIDGET_CLASS (gtk_label_parent_class)->state_flags_changed (widget, prev_state);
}
-static void
-gtk_label_style_updated (GtkWidget *widget)
-{
- GtkLabel *label = GTK_LABEL (widget);
-
- GTK_WIDGET_CLASS (gtk_label_parent_class)->style_updated (widget);
-
- /* We have to clear the layout, fonts etc. may have changed */
- gtk_label_clear_layout (label);
-}
-
-static void
-gtk_label_direction_changed (GtkWidget *widget,
- GtkTextDirection previous_dir)
-{
- GtkLabel *label = GTK_LABEL (widget);
- GtkLabelPrivate *priv = label->priv;
-
- if (priv->layout)
- pango_layout_context_changed (priv->layout);
-
- GTK_WIDGET_CLASS (gtk_label_parent_class)->direction_changed (widget, previous_dir);
-}
-
static void
get_layout_location (GtkLabel *label,
gint *xp,
* by gtk_widget_create_pango_context(), this context is owned by
* the widget (it can be used until the screen for the widget changes
* or the widget is removed from its toplevel), and will be updated to
- * match any changes to the widget's attributes.
- *
- * If you create and keep a #PangoLayout using this context, you must
- * deal with changes to the context by calling pango_layout_context_changed()
- * on the layout in response to the #GtkWidget::style-updated and
- * #GtkWidget::direction-changed signals for the widget.
+ * match any changes to the widget's attributes. This can be tracked
+ * by using the #GtkWidget::screen-changed signal on the widget.
*
* Return value: (transfer none): the #PangoContext for the widget.
**/
* font description, and base direction for drawing text for
* this widget.
*
- * If you keep a #PangoLayout created in this way around, in order to
- * notify the layout of changes to the base direction or font of this
- * widget, you must call pango_layout_context_changed() in response to
- * the #GtkWidget::style-updated and #GtkWidget::direction-changed signals
- * for the widget.
+ * If you keep a #PangoLayout created in this way around, you need
+ * to re-create it when the widget #PangoContext is replaced.
+ * This can be tracked by using the #GtkWidget::screen-changed signal
+ * on the widget.
*
* Return value: (transfer full): the new #PangoLayout
**/